<?php
set_include_path('../include');
require_once('Zend/Loader.php');
Zend_Loader::registerAutoload();
$config = new Zend_Config_Ini('../settings.ini','development');
Zend_Registry::set('config', $config);

$params = array('host' => 'localhost',
                'username' => 'extract',
                'password' => 'extractpw',
                'dbname'   => 'extract');

$logger = new Zend_Log(new Zend_Log_Writer_Stream($config->logging->file));
Zend_Registry::set('logger', $logger);

$db = Zend_Db::factory('pdo_mysql', $params);

$user = new DatabaseObject_User($db);
//$user->userName = 'someUser';
//$user->passWord = 'PassO';
//$user->save();
//
//$user->userType = 'admin';
//$user->email = 'cckylin@gmail.com';
//$user->save();
//
//$user2 = new DatabaseObject_User($db);
//if($user2->load(5)) {
//	$user2->delete();
//}

$user = new DatabaseObject_User($db);
$user->username = 'wori';
$user->password = 'psdf';

$user->profile->email = 'cckylin@hotmail.com';
$user->profile->country = 'usa';

$user->save();

$user2 = new DatabaseObject_User($db);
if($user2->load(2)) {
	$user2->delete();
}

echo 'hello';
?>